<script>
import zfb from './zfb.png'

import axios from 'axios'

export default {
    name: 'App',
    data() {
        return {
            count: 100,
            zfb,
            roomList: []
        }
    },
    methods: {
        addClick() {
            // console.log(1234567890);
            this.count++
        }
    },
    mounted() {
        axios.get('/api/RoomApi/live').then(res => {
            console.log(res.data);
            this.roomList = res.data.data
        })
    },
}
</script>
<template>
    <div>
        <h1> Vue 根组件 -- {{ count }}</h1>
        <button @click="addClick">点击增加</button>

        <img class="logo" :src="zfb" alt="">

        <ol>
            <li v-for="item in roomList" :key="item.room_id">
                <img :src="item.room_src" alt="">
                <h5>{{ item.room_name }}</h5>
            </li>
        </ol>

    </div>
</template>
<style lang="scss" scoped>
.logo {
    width: 150px;
    height: 150px;
}
</style>